{
	template:`
	<a-page-header :title="title">
		<template #extra>
		<a-popover placement="leftTop" :open="loadShow">
			<a-upload v-if="oper=='edit'" :show-upload-list="false" accept="*/*" v-model:file-list="updataList" @change="uploadChange" :multiple="true" :action="'action/manage/fileInfo/upload?fileType='+fileType+'&businessOid='+businessOid">
				<a-button type="primary" :loading="loadShow" :disabled="loadShow">上传</a-button>
			</a-upload>
			<template #content>
				<div v-for="item in updataList">
					{{item.name}}
					<a-progress :percent="item.percent" />
				</div>
			</template>
		</a-popover>
		    <m-back v-if="param.openType=='MODAL'||param.openType=='PAGE'||param.openType=='DRAWER'" @click="back(false);">关闭</m-back>
		</template>
		<a-card :hoverable="true" :bodyStyle="{padding:'5px'}">
			<a-list v-if="list.length>0" :data-source="list" size="small">
				<template #renderItem="{ item }">
					<a-list-item>
						<a-list-item-meta>
						<template #title><a :href="item.filePath" :download="item.name">{{item.name}}</a></template>
						</a-list-item-meta>
						<template #actions>
							<a-popconfirm placement="left" v-if="oper=='edit'&&admin.oid==item.imageAdmin.oid" title="确定要删除吗?" @confirm="deleteFile(item)">
								<a-button size="small" danger>删除</a-button>
							</a-popconfirm>
						</template>
					</a-list-item>
				</template>
			</a-list>
			<div v-else class="padding">暂无文件</div>
		</a-card>
	</a-page-header>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
			title:'',
			fileType:'',
			businessOid:'',
			oper:'',//edit view
			updataList:[],
			admin:{},
			list:[],
			loadShow:false,
			loadTimer:null,
		};
	},
	mounted(){
		this.title=this.param.title||'文件';
		this.fileType=this.param.fileType||'';
		this.businessOid=this.param.businessOid||'';
		this.oper=this.param.oper||'';
		this.loadList();
	},
	methods:{
		uploadChange:function(obj){
			if(obj.file.status=="done"){
				var json=JSON.parse(obj.file.xhr.response);
				this.list.push(json.model);
			}
			if(obj.fileList.length){
				var b=false;
				for(var i=0;i<obj.fileList.length;i++){
					if(obj.fileList[i].status!='done'){
						b=true;
					}
				}
				if(b){
					this.loadShow=b;
				}else{
					if(null!=this.loadTimer) clearTimeout(this.loadTimer);
					this.loadTimer=setTimeout(()=>{
						this.loadShow=b;
						this.updataList=[];
					},1500);
				}
			}
		},
		loadList:function(){
			this.requestData('action/manage/fileInfo/getBusiFile',
				{fileType:this.fileType,businessOid:this.businessOid},
				data=>{
					if(!data.code){
						this.list=data.list;
						this.admin=data.admin;
					}else{
						this.remind().error(data.msg);
					}
				}
			);
		},
		removeData:function(oid){
			for(var i=0;i<this.list.length;i++){
				if(this.list[i].oid==oid){
					this.list.splice(i,1);
					break;
				}
			}
		},
		deleteFile:function(item){
			this.requestData("action/manage/fileInfo/delete",{"fileOid":item.oid},function(data){
				if(data.code==0){
					this.remind().success(data.msg);
					this.removeData(data.oid);
				}else{
					this.remind().error(data.msg)
				}
			}.bind(this));
		},
	}
}